home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume10 / sps / part03 < prev    next >
Encoding:
Internet Message Format  |  1987-07-21  |  43.7 KB

  1. Path: uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i062:  SPS for BSD, Ultrix1.2, Sun3.x, NFS, Part03/03
  5. Message-ID: <691@uunet.UU.NET>
  6. Date: 23 Jul 87 00:20:04 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 1373
  9. Approved: rs@uunet.UU.NET
  10.  
  11. Submitted-by: robert@hslrswi.UUCP (Robert Ward)
  12. Posting-Number: Volume 10, Issue 62
  13. Archive-name: sps/Part03
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 3 (of 3)."
  22. # Contents:  patches sps.man
  23. # Wrapped by rs@uunet on Wed Jul 22 20:09:12 1987
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f patches -a "${1}" != "-c" ; then 
  26.   echo shar: Will not over-write existing file \"patches\"
  27. else
  28. echo shar: Extracting \"patches\" \(26834 characters\)
  29. sed "s/^X//" >patches <<'END_OF_patches'
  30. Xdiff -b -c sps/Makefile.4.2 sps.old/Makefile.4.2
  31. X*** sps/Makefile.4.2    Fri Dec  5 09:22:35 1986
  32. X--- sps.old/Makefile.4.2    Wed Dec 17 13:57:20 1986
  33. X***************
  34. X*** 1,4 ****
  35. X! # Makefile for SPS (Vax 4.2BSD and Ultrix1.2 UNIX Version)
  36. X  
  37. X  PROG    =       sps
  38. X  OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  39. X--- 1,4 ----
  40. X! # Makefile for SPS (4.2BSD UNIX Version)
  41. X  
  42. X  PROG    =       sps
  43. X  OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  44. X***************
  45. X*** 11,17 ****
  46. X  CC      =       cc
  47. X  CFLAGS  =       -DBSD42 -I/sys
  48. X  LIBS    =       -ltermlib
  49. X- DIRINSTALL =    /bin
  50. X  
  51. X  all:            $(PROG)
  52. X  .c.o:
  53. X--- 11,16 ----
  54. X***************
  55. X*** 27,36 ****
  56. X  
  57. X  install:        $(PROG)
  58. X          strip $(PROG)
  59. X!         mv $(PROG) $(DIRINSTALL)/$(PROG)
  60. X!         /etc/chown root $(DIRINSTALL)/$(PROG)
  61. X!         chgrp kmem $(DIRINSTALL)/$(PROG)
  62. X!         chmod 2755 $(DIRINSTALL)/$(PROG)
  63. X  
  64. X  lint:
  65. X          lint -x -b $(CFLAGS) *.c
  66. X--- 26,33 ----
  67. X  
  68. X  install:        $(PROG)
  69. X          strip $(PROG)
  70. X!         mv $(PROG) /bin/$(PROG)
  71. X!         /etc/chown root /bin/$(PROG)
  72. X  
  73. X  lint:
  74. X          lint -x -b $(CFLAGS) *.c
  75. XOnly in sps: Makefile.4.3
  76. Xdiff -b -c sps/Makefile.sun sps.old/Makefile.sun
  77. X*** sps/Makefile.sun    Tue Nov 25 11:34:08 1986
  78. X--- sps.old/Makefile.sun    Wed Dec 17 13:57:25 1986
  79. X***************
  80. X*** 1,4 ****
  81. X! # Makefile for SPS (Sun-2 and Sun-3, 4.2BSD UNIX Version)
  82. X  
  83. X  PROG    =       sps
  84. X  OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  85. X--- 1,4 ----
  86. X! # Makefile for SPS (Sun 4.2BSD UNIX Version)
  87. X  
  88. X  PROG    =       sps
  89. X  OBJS    =       filecount.o findtty.o flagdecode.o flagsetup.o \
  90. X***************
  91. X*** 11,17 ****
  92. X  CC      =       cc
  93. X  CFLAGS  =       -DSUN -DBSD42 -I/sys
  94. X  LIBS    =       -ltermlib
  95. X- DIRINSTALL    = /bin
  96. X  
  97. X  all:            $(PROG)
  98. X  .c.o:
  99. X--- 11,16 ----
  100. X***************
  101. X*** 27,36 ****
  102. X  
  103. X  install:        $(PROG)
  104. X          strip $(PROG)
  105. X!         mv $(PROG) $(DIRINSTALL)/$(PROG)
  106. X!         /etc/chown root $(DIRINSTALL)/$(PROG)
  107. X!         chgrp kmem $(DIRINSTALL)/$(PROG)
  108. X!         chmod 2755 $(DIRINSTALL)/$(PROG)
  109. X  
  110. X  lint:
  111. X          lint -x -b $(CFLAGS) *.c
  112. X--- 26,33 ----
  113. X  
  114. X  install:        $(PROG)
  115. X          strip $(PROG)
  116. X!         mv $(PROG) /bin/$(PROG)
  117. X!         /etc/chown root /bin/$(PROG)
  118. X  
  119. X  lint:
  120. X          lint -x -b $(CFLAGS) *.c
  121. Xdiff -b -c sps/findtty.c sps.old/findtty.c
  122. X*** sps/findtty.c    Tue Nov 25 11:34:10 1986
  123. X--- sps.old/findtty.c    Wed Dec 17 13:57:30 1986
  124. X***************
  125. X*** 1,5 ****
  126. X  # include       "sps.h"
  127. X- # include       <h/ioctl.h>
  128. X  # include       <h/tty.h>
  129. X  
  130. X  /* FINDTTY - Attempts to determine to which tty a process is connected */
  131. X--- 1,4 ----
  132. Xdiff -b -c sps/flagsetup.c sps.old/flagsetup.c
  133. X*** sps/flagsetup.c    Tue Nov 25 11:34:12 1986
  134. X--- sps.old/flagsetup.c    Wed Dec 17 13:57:49 1986
  135. X***************
  136. X*** 1,6 ****
  137. X  # include       "sps.h"
  138. X  # include       "flags.h"
  139. X- # include       <h/ioctl.h>
  140. X  # include       <h/tty.h>
  141. X  
  142. X  /*
  143. X--- 1,5 ----
  144. Xdiff -b -c sps/globals2.c sps.old/globals2.c
  145. X*** sps/globals2.c    Tue Nov 25 11:34:15 1986
  146. X--- sps.old/globals2.c    Wed Dec 17 13:58:26 1986
  147. X***************
  148. X*** 40,67 ****
  149. X      { "_usrpt",     0,  (caddr_t*)&Info.i_usrpt,    (char*)0        },
  150. X      { "_cdevsw",    0,  (caddr_t*)&Info.i_cdevsw,   (char*)0        },
  151. X  # ifdef BSD42
  152. X- # ifndef SUN
  153. X      { "_quota",     1,  (caddr_t*)&Info.i_quota0,   (char*)0        },
  154. X      { "_nquota",    1,  (caddr_t*)&Info.i_nquota,   (char*)0        },
  155. X- # endif SUN
  156. X      { "_dmmin",     1,  (caddr_t*)&Info.i_dmmin,    (char*)0        },
  157. X      { "_dmmax",     1,  (caddr_t*)&Info.i_dmmax,    (char*)0        },
  158. X      { "_mbutl",     0,  (caddr_t*)&Info.i_mbutl,    (char*)0        },
  159. X  # else
  160. X      { "_hz",        1,  (caddr_t*)&Info.i_hz,       (char*)0        },
  161. X! # endif BSD42
  162. X  # ifdef CHAOS
  163. X      { "_Chconntab", 0,  &Info.i_Chconntab,          (char*)0        },
  164. X! # endif CHAOS
  165. X      /* Kernel addresses associated with process wait states.
  166. X         It is not important if some of these addresses are unresolved
  167. X         at initialisation. */
  168. X- # ifndef SUN
  169. X      { "_fltab",     0,  &Info.i_waitstate[0],       "floppy"        },
  170. X      { "_tu",        0,  &Info.i_waitstate[1],       "tu58"          },
  171. X-     { "_lp_softc",  0,  &Info.i_waitstate[3],       "printr"        },
  172. X- # endif SUN
  173. X      { "_bfreelist", 0,  &Info.i_waitstate[2],       "buffer"        },
  174. X      { "_lbolt",     0,  &Info.i_waitstate[4],       "lbolt"         },
  175. X      { "_runin",     0,  &Info.i_waitstate[5],       "runin"         },
  176. X      { "_runout",    0,  &Info.i_waitstate[6],       "runout"        },
  177. X--- 40,63 ----
  178. X      { "_usrpt",     0,  (caddr_t*)&Info.i_usrpt,    (char*)0        },
  179. X      { "_cdevsw",    0,  (caddr_t*)&Info.i_cdevsw,   (char*)0        },
  180. X  # ifdef BSD42
  181. X      { "_quota",     1,  (caddr_t*)&Info.i_quota0,   (char*)0        },
  182. X      { "_nquota",    1,  (caddr_t*)&Info.i_nquota,   (char*)0        },
  183. X      { "_dmmin",     1,  (caddr_t*)&Info.i_dmmin,    (char*)0        },
  184. X      { "_dmmax",     1,  (caddr_t*)&Info.i_dmmax,    (char*)0        },
  185. X      { "_mbutl",     0,  (caddr_t*)&Info.i_mbutl,    (char*)0        },
  186. X  # else
  187. X      { "_hz",        1,  (caddr_t*)&Info.i_hz,       (char*)0        },
  188. X! # endif
  189. X  # ifdef CHAOS
  190. X      { "_Chconntab", 0,  &Info.i_Chconntab,          (char*)0        },
  191. X! # endif
  192. X      /* Kernel addresses associated with process wait states.
  193. X         It is not important if some of these addresses are unresolved
  194. X         at initialisation. */
  195. X      { "_fltab",     0,  &Info.i_waitstate[0],       "floppy"        },
  196. X      { "_tu",        0,  &Info.i_waitstate[1],       "tu58"          },
  197. X      { "_bfreelist", 0,  &Info.i_waitstate[2],       "buffer"        },
  198. X+     { "_lp_softc",  0,  &Info.i_waitstate[3],       "printr"        },
  199. X      { "_lbolt",     0,  &Info.i_waitstate[4],       "lbolt"         },
  200. X      { "_runin",     0,  &Info.i_waitstate[5],       "runin"         },
  201. X      { "_runout",    0,  &Info.i_waitstate[6],       "runout"        },
  202. X***************
  203. X*** 70,106 ****
  204. X      { "_freemem",   0,  &Info.i_waitstate[9],       "freemm"        },
  205. X      { "_kernelmap", 0,  &Info.i_waitstate[10],      "kermap"        },
  206. X      { "_cwaiting",  0,  &Info.i_waitstate[11],      "cwait"         },
  207. X  # ifdef BSD42
  208. X!     { "_selwait",   0,  &Info.i_waitstate[12],      "select"        },
  209. X! # endif BSD42
  210. X  # ifdef CHAOS
  211. X!     { "_Chrfclist", 0,  &Info.i_waitstate[13],      "chrfc"         },
  212. X  # endif
  213. X! # ifndef SUN
  214. X!     { "_rhpbuf",    0,  &Info.i_waitstate[14],      "rhpbuf"        },
  215. X!     { "_rhtbuf",    0,  &Info.i_waitstate[15],      "rhtbuf"        },
  216. X!     { "_ridcbuf",   0,  &Info.i_waitstate[16],      "ridcbf"        },
  217. X!     { "_rikbuf",    0,  &Info.i_waitstate[17],      "rikbuf"        },
  218. X!     { "_rmtbuf",    0,  &Info.i_waitstate[18],      "rmtbuf"        },
  219. X!     { "_rrkbuf",    0,  &Info.i_waitstate[19],      "rrkbuf"        },
  220. X!     { "_rrlbuf",    0,  &Info.i_waitstate[20],      "rrlbuf"        },
  221. X!     { "_rrxbuf",    0,  &Info.i_waitstate[21],      "rrxbuf"        },
  222. X!     { "_rswbuf",    0,  &Info.i_waitstate[22],      "rswbuf"        },
  223. X!     { "_rtmbuf",    0,  &Info.i_waitstate[23],      "rtmbuf"        },
  224. X!     { "_rtsbuf",    0,  &Info.i_waitstate[24],      "rtsbuf"        },
  225. X!     { "_rudbuf",    0,  &Info.i_waitstate[25],      "rudbuf"        },
  226. X!     { "_rupbuf",    0,  &Info.i_waitstate[26],      "rupbuf"        },
  227. X!     { "_rutbuf",    0,  &Info.i_waitstate[27],      "rutbuf"        },
  228. X!     { "_rvabuf",    0,  &Info.i_waitstate[28],      "rvabuf"        },
  229. X!     { "_rvpbuf",    0,  &Info.i_waitstate[29],      "rvpbuf"        },
  230. X!     { "_chtbuf",    0,  &Info.i_waitstate[30],      "chtbuf"        },
  231. X!     { "_cmtbuf",    0,  &Info.i_waitstate[31],      "cmtbuf"        },
  232. X!     { "_ctmbuf",    0,  &Info.i_waitstate[32],      "ctmbuf"        },
  233. X!     { "_ctsbuf",    0,  &Info.i_waitstate[33],      "ctsbuf"        },
  234. X!     { "_cutbuf",    0,  &Info.i_waitstate[34],      "cutbuf"        },
  235. X! # else
  236. X!     { "_async_bufhead", 0,  &Info.i_waitstate[14],  "async"        },
  237. X!     { "_desktops",    0,  &Info.i_waitstate[15],    "dtops"        },
  238. X! # endif SUN
  239. X      { (char*)0,     0,  (caddr_t*)0,                (char*)0        }
  240. X  } ;
  241. X--- 66,100 ----
  242. X      { "_freemem",   0,  &Info.i_waitstate[9],       "freemm"        },
  243. X      { "_kernelmap", 0,  &Info.i_waitstate[10],      "kermap"        },
  244. X      { "_cwaiting",  0,  &Info.i_waitstate[11],      "cwait"         },
  245. X+     { "_rhpbuf",    0,  &Info.i_waitstate[12],      "rhpbuf"        },
  246. X+     { "_rhtbuf",    0,  &Info.i_waitstate[13],      "rhtbuf"        },
  247. X+     { "_ridcbuf",   0,  &Info.i_waitstate[14],      "ridcbf"        },
  248. X+     { "_rikbuf",    0,  &Info.i_waitstate[15],      "rikbuf"        },
  249. X+     { "_rmtbuf",    0,  &Info.i_waitstate[16],      "rmtbuf"        },
  250. X+     { "_rrkbuf",    0,  &Info.i_waitstate[17],      "rrkbuf"        },
  251. X+     { "_rrlbuf",    0,  &Info.i_waitstate[18],      "rrlbuf"        },
  252. X+     { "_rrxbuf",    0,  &Info.i_waitstate[19],      "rrxbuf"        },
  253. X+     { "_rswbuf",    0,  &Info.i_waitstate[20],      "rswbuf"        },
  254. X+     { "_rtmbuf",    0,  &Info.i_waitstate[21],      "rtmbuf"        },
  255. X+     { "_rtsbuf",    0,  &Info.i_waitstate[22],      "rtsbuf"        },
  256. X+     { "_rudbuf",    0,  &Info.i_waitstate[23],      "rudbuf"        },
  257. X+     { "_rupbuf",    0,  &Info.i_waitstate[24],      "rupbuf"        },
  258. X+     { "_rutbuf",    0,  &Info.i_waitstate[25],      "rutbuf"        },
  259. X+     { "_rvabuf",    0,  &Info.i_waitstate[26],      "rvabuf"        },
  260. X+     { "_rvpbuf",    0,  &Info.i_waitstate[27],      "rvpbuf"        },
  261. X+     { "_chtbuf",    0,  &Info.i_waitstate[28],      "chtbuf"        },
  262. X+     { "_cmtbuf",    0,  &Info.i_waitstate[29],      "cmtbuf"        },
  263. X+     { "_ctmbuf",    0,  &Info.i_waitstate[30],      "ctmbuf"        },
  264. X+     { "_ctsbuf",    0,  &Info.i_waitstate[31],      "ctsbuf"        },
  265. X+     { "_cutbuf",    0,  &Info.i_waitstate[32],      "cutbuf"        },
  266. X  # ifdef BSD42
  267. X!     { "_selwait",   0,  &Info.i_waitstate[33],      "select"        },
  268. X! # endif
  269. X  # ifdef CHAOS
  270. X!     { "_Chrfclist", 0,  &Info.i_waitstate[34],      "chrfc"         },
  271. X  # endif
  272. X! # ifdef SUN
  273. X!     { "_async_bufhead", 0,  &Info.i_waitstate[35],  "async"        },
  274. X! # endif
  275. X      { (char*)0,     0,  (caddr_t*)0,                (char*)0        }
  276. X  } ;
  277. Xdiff -b -c sps/hashuid.c sps.old/hashuid.c
  278. X*** sps/hashuid.c    Tue Nov 25 11:34:16 1986
  279. X--- sps.old/hashuid.c    Wed Dec 17 13:58:30 1986
  280. X***************
  281. X*** 1,8 ****
  282. X  # include       "sps.h"
  283. X  
  284. X  /* The hashing functions themselves ... */
  285. X! # define        HASHFN1( a )            (((unsigned)(a)*91 + 17) % MAXUSERID)
  286. X! # define        HASHFN2( a )            (((unsigned)(a) + 47) % MAXUSERID)
  287. X  
  288. X  /*
  289. X  ** HASHUID - Returns a pointer to a slot in the hash table that corresponds
  290. X--- 1,8 ----
  291. X  # include       "sps.h"
  292. X  
  293. X  /* The hashing functions themselves ... */
  294. X! # define        HASHFN1( a )            (((a)*91 + 17) % MAXUSERID)
  295. X! # define        HASHFN2( a )            (((a) + 47) % MAXUSERID)
  296. X  
  297. X  /*
  298. X  ** HASHUID - Returns a pointer to a slot in the hash table that corresponds
  299. Xdiff -b -c sps/initsymbols.c sps.old/initsymbols.c
  300. X*** sps/initsymbols.c    Fri Dec  5 09:47:23 1986
  301. X--- sps.old/initsymbols.c    Wed Dec 17 13:58:38 1986
  302. X***************
  303. X*** 48,54 ****
  304. X          sysperror() ;
  305. X      }
  306. X      /* Get kernel addresses */
  307. X!     (void)nlist( filesymbol, np0 ) ;              
  308. X      if ( np0[0].n_value == -1 )
  309. X      {
  310. X          fprintf( stderr, "sps - Can't read symbol file %s", filesymbol);
  311. X--- 48,54 ----
  312. X          sysperror() ;
  313. X      }
  314. X      /* Get kernel addresses */
  315. X!     nlist( filesymbol, np0 ) ;              
  316. X      if ( np0[0].n_value == -1 )
  317. X      {
  318. X          fprintf( stderr, "sps - Can't read symbol file %s", filesymbol);
  319. Xdiff -b -c sps/inittty.c sps.old/inittty.c
  320. X*** sps/inittty.c    Tue Nov 25 11:34:17 1986
  321. X--- sps.old/inittty.c    Wed Dec 17 13:58:48 1986
  322. X***************
  323. X*** 1,6 ****
  324. X  # include       "sps.h"
  325. X  # include       <h/conf.h>
  326. X- # include       <h/ioctl.h>
  327. X  # include       <h/tty.h>
  328. X  # include       <sys/stat.h>
  329. X  # include       <stdio.h>
  330. X--- 1,5 ----
  331. Xdiff -b -c sps/main.c sps.old/main.c
  332. X*** sps/main.c    Tue Nov 25 11:34:18 1986
  333. X--- sps.old/main.c    Wed Dec 17 13:59:04 1986
  334. X***************
  335. X*** 1,14 ****
  336. X  # include       "sps.h"
  337. X  # include       "flags.h"
  338. X  # include       <h/text.h>
  339. X- # include       <sys/stat.h>
  340. X  # include       <stdio.h>
  341. X  
  342. X- 
  343. X  /* SPS - Show Process Status */
  344. X! /* J. R. Ward - Hasler AG Bern, CH - 24 May 1985 */
  345. X! /*                     26 Nov 1986 */
  346. X! 
  347. X  main ( argc,argv )
  348. X  
  349. X  int                             argc ;
  350. X--- 1,10 ----
  351. X  # include       "sps.h"
  352. X  # include       "flags.h"
  353. X  # include       <h/text.h>
  354. X  # include       <stdio.h>
  355. X  
  356. X  /* SPS - Show Process Status */
  357. X! /* J. R. Ward - Hasler AG Bern - 24 May 1985 */
  358. X  main ( argc,argv )
  359. X  
  360. X  int                             argc ;
  361. X***************
  362. X*** 19,26 ****
  363. X      register struct process *process ;
  364. X      register struct text    *text ;
  365. X      int                     flinfo ;
  366. X-     char            *fileinfo, *filesymbol ;
  367. X-     struct stat        sinfo, ssymbol, spasswd ;
  368. X      extern struct flags     Flg ;
  369. X      extern struct info      Info ;
  370. X      extern int              Flmem ;
  371. X--- 15,20 ----
  372. X***************
  373. X*** 29,36 ****
  374. X      char                    *getcore() ;
  375. X      struct process          *needed(), *mktree() ;
  376. X  
  377. X!     /* Renice as fast as possible for root only (Suggested by Jeff Mogul,
  378. X!        gregorio!mogul) */
  379. X      if ( !getuid() )
  380. X          (void)nice( -40 ) ;
  381. X      /* Decode the flag arguments */
  382. X--- 23,29 ----
  383. X      char                    *getcore() ;
  384. X      struct process          *needed(), *mktree() ;
  385. X  
  386. X!     /* Renice as fast as possible for root (Suggested by Gregorio!mogul) */
  387. X      if ( !getuid() )
  388. X          (void)nice( -40 ) ;
  389. X      /* Decode the flag arguments */
  390. X***************
  391. X*** 56,82 ****
  392. X          initialise() ;          
  393. X          exit( 0 ) ;
  394. X      }
  395. X-     /* Check that the information file is newer than the symbol and
  396. X-        password files, suggested by gregorio!mogul */
  397. X-     fileinfo = Flg.flg_j ? Flg.flg_j : FILE_INFO ;
  398. X-     filesymbol = Flg.flg_s ? Flg.flg_s : FILE_SYMBOL ;
  399. X-     flinfo = openfile( fileinfo ) ;
  400. X-     (void)fstat( flinfo, &sinfo ) ;
  401. X-     if ( !stat( filesymbol, &ssymbol ) &&
  402. X-         sinfo.st_mtime < ssymbol.st_mtime )
  403. X-         fprintf( stderr,
  404. X-            "sps - WARNING: Info file `%s' is older than symbol file `%s'\n",
  405. X-             fileinfo, filesymbol ) ;
  406. X-     if ( !stat( FILE_PASSWD, &spasswd ) &&
  407. X-         sinfo.st_mtime < spasswd.st_mtime )
  408. X-         fprintf( stderr,
  409. X-            "sps - WARNING: Info file `%s' is older than passwd file `%s'\n",
  410. X-             fileinfo, FILE_PASSWD ) ;
  411. X      /* Read the information file */
  412. X      if ( read( flinfo, (char*)&Info, sizeof( struct info ) )
  413. X      != sizeof( struct info ) )
  414. X      {
  415. X!         fprintf( stderr, "sps - Can't read info file `%s'", fileinfo ) ;
  416. X          sysperror() ;
  417. X      }
  418. X      (void)close( flinfo ) ;
  419. X--- 49,61 ----
  420. X          initialise() ;          
  421. X          exit( 0 ) ;
  422. X      }
  423. X      /* Read the information file */
  424. X+     flinfo = openfile( Flg.flg_j ? Flg.flg_j : FILE_INFO ) ;
  425. X      if ( read( flinfo, (char*)&Info, sizeof( struct info ) )
  426. X      != sizeof( struct info ) )
  427. X      {
  428. X!         fprintf( stderr, "sps - Can't read info file %s",
  429. X!             Flg.flg_j ? Flg.flg_j : FILE_INFO ) ;
  430. X          sysperror() ;
  431. X      }
  432. X      (void)close( flinfo ) ;
  433. Xdiff -b -c sps/printproc.c sps.old/printproc.c
  434. X*** sps/printproc.c    Fri Dec  5 09:48:22 1986
  435. X--- sps.old/printproc.c    Wed Dec 17 13:59:53 1986
  436. X***************
  437. X*** 32,38 ****
  438. X          p->pr_p.p_flag & SDETACH ? '_' :
  439. X  # endif
  440. X          p->pr_p.p_pgrp == p->pr_tty->l_pgrp ? '.' : ' ' ) ;
  441. X!     hp = hashuid( (int)p->pr_p.p_uid ) ;
  442. X      if ( !md  )                             
  443. X      {       /* If a top-level process, list the user name */
  444. X          if ( hp )
  445. X--- 32,38 ----
  446. X          p->pr_p.p_flag & SDETACH ? '_' :
  447. X  # endif
  448. X          p->pr_p.p_pgrp == p->pr_tty->l_pgrp ? '.' : ' ' ) ;
  449. X!     hp = hashuid( p->pr_p.p_uid ) ;
  450. X      if ( !md  )                             
  451. X      {       /* If a top-level process, list the user name */
  452. X          if ( hp )
  453. Xdiff -b -c sps/selectproc.c sps.old/selectproc.c
  454. X*** sps/selectproc.c    Fri Dec  5 09:02:28 1986
  455. X--- sps.old/selectproc.c    Wed Dec 17 14:00:04 1986
  456. X***************
  457. X*** 1,8 ****
  458. X  # include       "sps.h"
  459. X  # include       "flags.h"
  460. X- # ifdef USELOGINUID
  461. X- # include    <pwd.h>
  462. X- # endif USELOGINUID
  463. X  
  464. X  /*
  465. X  ** SELECTPROC - Given a process structure, this procedure decides whether
  466. X--- 1,5 ----
  467. X***************
  468. X*** 17,28 ****
  469. X  {
  470. X      register union flaglist *fp ;
  471. X      register struct process *pp ;
  472. X- #ifdef USELOGINUID
  473. X-     char            *username ;
  474. X-     struct passwd        *pw ;
  475. X-     char            *getlogin() ;
  476. X-     struct passwd        *getpwnam() ;
  477. X- #endif USELOGINUID
  478. X      extern struct flags     Flg ;
  479. X  
  480. X      /* Flg.flg_AZ is an internal flag set if one of flags `A' to `Z'
  481. X--- 14,19 ----
  482. X***************
  483. X*** 29,43 ****
  484. X         was specified. If this is not set, a process is listed only
  485. X         if it or one of its ancestors belongs to the invoking user. */
  486. X      if ( !Flg.flg_AZ )
  487. X-     {
  488. X- #ifdef USELOGINUID
  489. X-         thisuid = (username = getlogin())
  490. X-             && (pw = getpwnam( username )) ? pw->pw_uid : getuid() ;
  491. X- #endif USELOGINUID
  492. X          for ( pp = p ; pp > &process[1] ; pp = pp->pr_pptr )
  493. X              if ( thisuid == pp->pr_p.p_uid )
  494. X                  return ( 1 ) ;
  495. X-     }
  496. X      if ( Flg.flg_A )
  497. X          return ( 1 ) ;
  498. X      if ( Flg.flg_P )
  499. X--- 20,28 ----
  500. Xdiff -b -c sps/sps.h sps.old/sps.h
  501. X*** sps/sps.h    Tue Nov 25 11:34:28 1986
  502. X--- sps.old/sps.h    Wed Dec 17 14:00:12 1986
  503. X***************
  504. X*** 9,25 ****
  505. X  */
  506. X  # define    MAXUSERID    100
  507. X  /* Maximum # ttys to be considered ... */
  508. X! # define    MAXTTYS        65
  509. X  /* Maximum user name length ... */
  510. X  # define    UNAMELEN    8
  511. X  /* Maximum process-id not to be considered busy ... */
  512. X  # define    MSPID        2
  513. X  /* # of wait states defined in the `struct info' ... */
  514. X! # ifdef SUN
  515. X! # define    NWAITSTATE    16
  516. X! # else
  517. X! # define    NWAITSTATE    35
  518. X! # endif
  519. X  
  520. X  /* Convert clicks to kbytes ... */
  521. X  # ifdef SUN
  522. X--- 9,21 ----
  523. X  */
  524. X  # define        MAXUSERID       100
  525. X  /* Maximum # ttys to be considered ... */
  526. X! # define        MAXTTYS         60
  527. X  /* Maximum user name length ... */
  528. X  # define        UNAMELEN        8
  529. X  /* Maximum process-id not to be considered busy ... */
  530. X  # define        MSPID           2
  531. X  /* # of wait states defined in the `struct info' ... */
  532. X! # define        NWAITSTATE      36
  533. X  
  534. X  /* Convert clicks to kbytes ... */
  535. X  # ifdef SUN
  536. X***************
  537. X*** 35,41 ****
  538. X  # define    FILE_DEV    "/dev"        /* Directory of tty entries */
  539. X  # define    FILE_SYMBOL    "/vmunix"    /* Symbol file for nlist() */
  540. X  # define    FILE_INFO    "/etc/spsinfo"    /* Sps information file */
  541. X- # define    FILE_PASSWD    "/etc/passwd"    /* User database */
  542. X  
  543. X  /* Structure to hold necessary information concerning a tty ... */
  544. X  struct ttyline
  545. X--- 31,36 ----
  546. X***************
  547. X*** 49,55 ****
  548. X  /* Structure holding a single hash table entry ... */
  549. X  struct hashtab
  550. X  {
  551. X!     short            h_uid ;        /* Uid of user entry */
  552. X      char            h_uname[ UNAMELEN ] ; /* Corresponding name */
  553. X  } ;
  554. X  
  555. X--- 44,50 ----
  556. X  /* Structure holding a single hash table entry ... */
  557. X  struct hashtab
  558. X  {
  559. X!     unsigned short          h_uid ;         /* Uid of user entry */
  560. X      char                    h_uname[ UNAMELEN ] ; /* Corresponding name */
  561. X  } ;
  562. X  
  563. Xdiff -b -c sps/termwidth.c sps.old/termwidth.c
  564. X*** sps/termwidth.c    Thu Dec 11 10:42:33 1986
  565. X--- sps.old/termwidth.c    Wed Dec 17 14:00:17 1986
  566. X***************
  567. X*** 1,5 ****
  568. X- #include    <sys/ioctl.h>
  569. X- 
  570. X  /*
  571. X  ** TERMWIDTH - Sets the external variable `Termwidth' to the # of columns
  572. X  ** on the terminal.
  573. X--- 1,3 ----
  574. X***************
  575. X*** 8,28 ****
  576. X  {
  577. X      register char           *termtype ;
  578. X      register int            twidth ;
  579. X- #ifdef TIOCGWINSZ
  580. X-     struct winsize        w ;
  581. X- #endif
  582. X      char                    buf[ 1025 ] ;
  583. X      extern unsigned         Termwidth ;
  584. X      char                    *getenv() ;
  585. X  
  586. X- #ifdef TIOCGWINSZ
  587. X-     w.ws_col = 0 ;
  588. X-     if ( !ioctl( 0, TIOCGWINSZ, &w ) && w.ws_col )
  589. X-     {
  590. X-         Termwidth = w.ws_col ;
  591. X-         return ;
  592. X-     }
  593. X- #endif
  594. X      Termwidth = 80 ;
  595. X      if ( !(termtype = getenv( "TERM" )) )
  596. X          return ;
  597. X--- 6,15 ----
  598. Xdiff -b -c sps/ttystatus.c sps.old/ttystatus.c
  599. X*** sps/ttystatus.c    Tue Nov 25 11:34:28 1986
  600. X--- sps.old/ttystatus.c    Wed Dec 17 14:00:20 1986
  601. X***************
  602. X*** 1,7 ****
  603. X  # include       "sps.h"
  604. X  # include       "flags.h"
  605. X  # include       <stdio.h>
  606. X- # include       <h/ioctl.h>
  607. X  # include       <h/tty.h>
  608. X  # ifdef CHAOS
  609. X  # include       <chunix/chsys.h>
  610. X--- 1,6 ----
  611. Xdiff -b -c sps/waitingfor.c sps.old/waitingfor.c
  612. X*** sps/waitingfor.c    Fri Dec  5 11:23:05 1986
  613. X--- sps.old/waitingfor.c    Wed Dec 17 14:00:31 1986
  614. X***************
  615. X*** 1,4 ****
  616. X--- 1,5 ----
  617. X  # include       "sps.h"
  618. X+ # include       <h/tty.h>
  619. X  # include       <h/text.h>
  620. X  # ifdef SUN
  621. X  # include       <h/vnode.h>
  622. X***************
  623. X*** 5,22 ****
  624. X  # include       <ufs/inode.h>
  625. X  # else
  626. X  # include       <h/inode.h>
  627. X! # endif SUN
  628. X! # include       <h/ioctl.h>
  629. X! # include       <h/tty.h>
  630. X  # include       <h/buf.h>
  631. X  # ifdef BSD42
  632. X- # ifndef SUN
  633. X  # include       <h/quota.h>
  634. X- # endif SUN
  635. X  # include       <h/mbuf.h>
  636. X  # include       <h/socket.h>
  637. X  # include       <h/socketvar.h>
  638. X! # endif BSD42
  639. X  
  640. X  /* 1 if `w' is in the address range defined by `a1' and `a2' ... */
  641. X  # define        INRANGE( w, a1, a2 ) \
  642. X--- 6,19 ----
  643. X  # include       <ufs/inode.h>
  644. X  # else
  645. X  # include       <h/inode.h>
  646. X! # endif
  647. X  # include       <h/buf.h>
  648. X  # ifdef BSD42
  649. X  # include       <h/quota.h>
  650. X  # include       <h/mbuf.h>
  651. X  # include       <h/socket.h>
  652. X  # include       <h/socketvar.h>
  653. X! # endif
  654. X  
  655. X  /* 1 if `w' is in the address range defined by `a1' and `a2' ... */
  656. X  # define        INRANGE( w, a1, a2 ) \
  657. X***************
  658. X*** 35,41 ****
  659. X  # ifdef BSD42
  660. X      struct socket           sc ;
  661. X  # endif
  662. X-     int            rc ;
  663. X      static char             wbuf[ 8 ] ;
  664. X      extern struct info      Info ;
  665. X      extern struct symbol    Symbollist[] ;
  666. X--- 32,37 ----
  667. X***************
  668. X*** 59,75 ****
  669. X      if ( INRANGE( w, Info.i_text0, &Info.i_text0[ Info.i_ntext ] ) )
  670. X          return ( "swtext" ) ;
  671. X  # ifdef BSD42
  672. X- # ifndef SUN
  673. X      /* Waiting for an event associated with the quota system ? */
  674. X      if ( INRANGE( w, Info.i_quota0, &Info.i_quota0[ Info.i_nquota ] ) )
  675. X          return ( "quota" ) ;
  676. X! # endif SUN
  677. X! # endif BSD42
  678. X      /* Waiting for tty I/O ? If so, find which tty it is */
  679. X      for ( lp = Info.i_ttyline ; lp->l_name[0] ; lp++ )
  680. X          if ( INRANGE( w, &lp->l_addr[0], &lp->l_addr[1] ) )
  681. X          {
  682. X!             switch ( (int)w - (int)lp->l_addr )
  683. X              {
  684. X                  case (int)&((struct tty*)0)->t_rawq :
  685. X                      /* Read from a tty or slave pty */
  686. X--- 55,69 ----
  687. X      if ( INRANGE( w, Info.i_text0, &Info.i_text0[ Info.i_ntext ] ) )
  688. X          return ( "swtext" ) ;
  689. X  # ifdef BSD42
  690. X      /* Waiting for an event associated with the quota system ? */
  691. X      if ( INRANGE( w, Info.i_quota0, &Info.i_quota0[ Info.i_nquota ] ) )
  692. X          return ( "quota" ) ;
  693. X! # endif
  694. X      /* Waiting for tty I/O ? If so, find which tty it is */
  695. X      for ( lp = Info.i_ttyline ; lp->l_name[0] ; lp++ )
  696. X          if ( INRANGE( w, &lp->l_addr[0], &lp->l_addr[1] ) )
  697. X          {
  698. X!             switch ( w - (int)lp->l_addr )
  699. X              {
  700. X                  case (int)&((struct tty*)0)->t_rawq :
  701. X                      /* Read from a tty or slave pty */
  702. X***************
  703. X*** 111,117 ****
  704. X              case (int)&((struct inode*)0)->i_shlockc :
  705. X                  /* Shared lock on this inode */
  706. X                  return ( "shlock" ) ;
  707. X! # endif SUN
  708. X  # else
  709. X              case 1 :
  710. X                  return ( "wpipe" ) ;
  711. X--- 105,111 ----
  712. X              case (int)&((struct inode*)0)->i_shlockc :
  713. X                  /* Shared lock on this inode */
  714. X                  return ( "shlock" ) ;
  715. X! # endif
  716. X  # else
  717. X              case 1 :
  718. X                  return ( "wpipe" ) ;
  719. X***************
  720. X*** 119,125 ****
  721. X                  return ( "rpipe" ) ;
  722. X              case (int)&((struct inode*)0)->i_un.i_group.g_datq :
  723. X                  return ( "rmux" ) ;
  724. X! # endif BSD42
  725. X              default :
  726. X                  /* Inode probably locked */
  727. X                  return ( "inode" ) ;
  728. X--- 113,119 ----
  729. X                  return ( "rpipe" ) ;
  730. X              case (int)&((struct inode*)0)->i_un.i_group.g_datq :
  731. X                  return ( "rmux" ) ;
  732. X! # endif
  733. X              default :
  734. X                  /* Inode probably locked */
  735. X                  return ( "inode" ) ;
  736. X***************
  737. X*** 132,146 ****
  738. X              - (int)&((struct mbuf*)0)->m_dat[0] )
  739. X          {
  740. X              case (int)&((struct socket*)0)->so_timeo :
  741. X!                 /* Socket timeout event - Guess why */
  742. X!                 rc = getsocket( (struct socket*)(w
  743. X!                     - (int)&((struct socket*)0)->so_timeo),
  744. X!                         &sc ) ;
  745. X!                 return ( rc && (sc.so_state & SS_ISCONNECTING)
  746. X!                     ? "connct" 
  747. X!                     : rc && ((sc.so_options & SO_ACCEPTCONN)
  748. X!                       && !sc.so_qlen)
  749. X!                     ? "accept" : "socket" ) ;
  750. X              case (int)&((struct socket*)0)->so_rcv.sb_cc :
  751. X                  /* Read from an empty socket. Here we actually
  752. X                     attempt to determine whether the socket
  753. X--- 126,133 ----
  754. X              - (int)&((struct mbuf*)0)->m_dat[0] )
  755. X          {
  756. X              case (int)&((struct socket*)0)->so_timeo :
  757. X!                 /* Socket timeout event */
  758. X!                 return ( "socket" ) ;
  759. X              case (int)&((struct socket*)0)->so_rcv.sb_cc :
  760. X                  /* Read from an empty socket. Here we actually
  761. X                     attempt to determine whether the socket
  762. X***************
  763. X*** 151,166 ****
  764. X                      - (int)&((struct socket*)0)->so_rcv.sb_cc),
  765. X                          &sc )
  766. X                      && sc.so_type == SOCK_STREAM
  767. X- #ifdef BSD43
  768. X-                     && ((sc.so_state
  769. X-                         & (SS_ISCONNECTED|SS_CANTSENDMORE))
  770. X-                         == (SS_ISCONNECTED|SS_CANTSENDMORE))
  771. X- #else
  772. X                      && !sc.so_rcv.sb_hiwat
  773. X                      && !sc.so_rcv.sb_mbmax
  774. X                      && (sc.so_state
  775. X                          & (SS_ISCONNECTED|SS_CANTRCVMORE))
  776. X- #endif BSD43
  777. X                      ? "rpipe" : "rsockt" ) ;
  778. X              case (int)&((struct socket*)0)->so_snd.sb_cc :
  779. X                  /* Write to a full socket. Again, we try
  780. X--- 138,147 ----
  781. X***************
  782. X*** 169,191 ****
  783. X                  return ( getsocket( (struct socket*)(w
  784. X                      - (int)&((struct socket*)0)->so_snd.sb_cc),
  785. X                          &sc )
  786. X- #ifdef BSD43
  787. X                      && sc.so_type == SOCK_STREAM
  788. X-                     && ((sc.so_state
  789. X-                         & (SS_ISCONNECTED|SS_CANTRCVMORE))
  790. X-                         == (SS_ISCONNECTED|SS_CANTRCVMORE))
  791. X- #else
  792. X                      && sc.so_rcv.sb_hiwat == 2048
  793. X                      && sc.so_rcv.sb_mbmax == 4096
  794. X                      && (sc.so_state
  795. X                          & (SS_ISCONNECTED|SS_CANTSENDMORE))
  796. X- #endif BSD43
  797. X                      ? "wpipe" : "wsockt" ) ;
  798. X              default :
  799. X                  /* Other mbuf event */
  800. X                  return ( "mbuf" ) ;
  801. X          }
  802. X! # endif SUN
  803. X      /* Look in the symbol table for known wait addresses. */
  804. X      for ( s = Symbollist ; s->s_kname ; s++ )
  805. X          if ( s->s_wait && w == *s->s_info )
  806. X--- 150,166 ----
  807. X                  return ( getsocket( (struct socket*)(w
  808. X                      - (int)&((struct socket*)0)->so_snd.sb_cc),
  809. X                          &sc )
  810. X                      && sc.so_type == SOCK_STREAM
  811. X                      && sc.so_rcv.sb_hiwat == 2048
  812. X                      && sc.so_rcv.sb_mbmax == 4096
  813. X                      && (sc.so_state
  814. X                          & (SS_ISCONNECTED|SS_CANTSENDMORE))
  815. X                      ? "wpipe" : "wsockt" ) ;
  816. X              default :
  817. X                  /* Other mbuf event */
  818. X                  return ( "mbuf" ) ;
  819. X          }
  820. X! # endif
  821. X      /* Look in the symbol table for known wait addresses. */
  822. X      for ( s = Symbollist ; s->s_kname ; s++ )
  823. X          if ( s->s_wait && w == *s->s_info )
  824. X***************
  825. X*** 196,202 ****
  826. X      (void)sprintf( wbuf, "x%05x", w ) ;
  827. X  # else
  828. X      (void)sprintf( wbuf, "x%05x", w - 0x80000000 ) ;
  829. X! # endif SUN
  830. X      return ( wbuf ) ;
  831. X  }
  832. X  
  833. X--- 171,177 ----
  834. X      (void)sprintf( wbuf, "x%05x", w ) ;
  835. X  # else
  836. X      (void)sprintf( wbuf, "x%05x", w - 0x80000000 ) ;
  837. X! # endif
  838. X      return ( wbuf ) ;
  839. X  }
  840. X  
  841. X***************
  842. X*** 217,220 ****
  843. X      return ( read( Flkmem, (char*)s, sizeof( struct socket ) )
  844. X          == sizeof( struct socket ) ) ;
  845. X  }
  846. X! # endif BSD42
  847. X--- 192,195 ----
  848. X      return ( read( Flkmem, (char*)s, sizeof( struct socket ) )
  849. X          == sizeof( struct socket ) ) ;
  850. X  }
  851. X! # endif
  852. X
  853. END_OF_patches
  854. if test 26834 -ne `wc -c <patches`; then
  855.     echo shar: \"patches\" unpacked with wrong size!
  856. fi
  857. # end of overwriting check
  858. fi
  859. if test -f sps.man -a "${1}" != "-c" ; then 
  860.   echo shar: Will not over-write existing file \"sps.man\"
  861. else
  862. echo shar: Extracting \"sps.man\" \(14462 characters\)
  863. sed "s/^X//" >sps.man <<'END_OF_sps.man'
  864. X.if n .pl 66
  865. X.TH SPS LOCAL
  866. X.SH NAME
  867. Xsps \ \ \-\ \ \ show process status
  868. X.SH SYNOPSIS
  869. X\fBsps\ \fP \ [ \fB-defgijkoqrslvwyABDFNPSTUWZ\fP ]\ \ [
  870. X\fIprocess\ .\ \. | tty\ .\ \. | user\ .\ .\ .\fP ]
  871. X.SH DESCRIPTION
  872. X\fISps\fP reports information concerning system processes.
  873. XIt shows the current state of any process by
  874. Xlisting information such as ownership, CPU time usage, memory usage
  875. Xand disc activity.
  876. X.PP
  877. X\fISps\fP should be used in preference to \fIps\fP(1)
  878. Xas it is faster and the output is easier to understand.
  879. X.SH OPTIONS
  880. XBy default, \fIsps\fP prints basic information about one's own processes.
  881. XThe various options described below select other processes or make
  882. X\fIsps\fP more verbose.
  883. X.PP
  884. XUpper case options select processes to be described.
  885. XLower case options specify the format of the output.
  886. XFor instance, the options \fBBv\fP specify that \fIsps\fP
  887. Xshould list "busy" processes in a verbose format.
  888. XUnless there is any conflict, lower case options may be used
  889. Xinstead of upper case options, and vice versa.
  890. X.PP
  891. XThe following options specify the format of the listed output -
  892. X.TP 8
  893. X\fB-d\fP
  894. XList output reflecting how each process affects the
  895. Xdisc and paging activity of the system.
  896. X.TP
  897. X\fB-e\fP
  898. XList the environment passed to each process.
  899. X.TP
  900. X\fB-f\fP
  901. XInclude the process-id of the parent of each process.
  902. X.TP
  903. X\fB-g\fP
  904. XInclude the process group of each process.
  905. X.TP
  906. X\fB-o\fP
  907. XAvoid looking at the swap device (\fB/dev/drum\fP). This tends to make \fIsps\fP
  908. Xrun faster, although no information concerning swapped processes
  909. Xcan be obtained.
  910. X.TP
  911. X\fB-q\fP
  912. XBy default, \fIsps\fP
  913. Xlists the sum of the user plus system times under the
  914. X\fITime\fP and \fIChild\fP fields.  This option forces \fIsps\fP
  915. Xto list only the user times.
  916. X.TP
  917. X\fB-r\fP
  918. XRepeat the output indefinitely.
  919. XIf the next argument is numeric, \fIsps\fP repeats the output with that
  920. Xmany seconds delay between each repetition.
  921. XOtherwise the output is repeated with no delay.
  922. X.TP
  923. X\fB-l\fP
  924. X.br
  925. X.ns
  926. X.TP
  927. X\fB-v\fP
  928. XList additional information in a verbose format. See below.
  929. X.TP
  930. X\fB-w\fP
  931. XList output in a wide format.  This option forces \fIsps\fP
  932. Xto print all the command arguments, even if doing so extends the output
  933. Xbeyond one line.
  934. X.TP
  935. X\fB-y\fP
  936. XShow the status of each terminal line.
  937. X.PP
  938. XThe following options specify which processes are to be described -
  939. X.TP 8
  940. X\fB-A\fP
  941. XList all processes.
  942. X.TP
  943. X\fB-B\fP
  944. XList busy processes.  A process is considered to be busy
  945. Xif it is immediately runnable or awaiting a fast event such as disc I/O.
  946. X.TP
  947. X\fB-D\fP
  948. XList detached processes.
  949. X.TP
  950. X\fB-F\fP
  951. XList foreground processes.
  952. X.TP
  953. X\fB-N\fP
  954. XShow no processes at all. Only the summary line is printed.
  955. X.TP
  956. X\fB-P\fP
  957. XList only processes whose identifiers are specified in the following arguments.
  958. X.TP
  959. X\fB-S\fP
  960. XList stopped processes.
  961. X.TP
  962. X\fB-T\fP
  963. XList only processes attached to the following specified terminals.
  964. X.TP
  965. X\fB-U\fP
  966. XList only processes belonging to the following specified users.
  967. X.TP
  968. X\fB-W\fP
  969. XList waiting processes.
  970. X.TP
  971. X\fB-Z\fP
  972. XList zomby (exiting) processes.
  973. X.PP
  974. XThe following are miscellaneous options -
  975. X.TP 8
  976. X\fB-i\fP
  977. XInitialise \fIsps\fP.
  978. XThis is necessary if new users are added to the password file,
  979. Xor if a new version of UNIX is installed.
  980. XSps builds a new information file summarising pertinent information
  981. Xread from the password file (\fB/etc/passwd\fP), the executable kernel image
  982. X(\fB/vmunix\fP) and the directory of tty devices (\fB/dev\fP).
  983. XSee also the \fB-j\fP and \fB-s\fP options.
  984. X.TP
  985. X\fB-j\fP
  986. XSpecify an information file other than the default (\fB/etc/spsinfo\fP).
  987. XThe next argument is taken to be the name of a suitable information file.
  988. XIf the \fB-i\fP flag is also specified, \fIsps\fP builds a
  989. Xnew information file with the given name.
  990. XOtherwise, \fBsps\fP reads previously created summarising information
  991. Xfrom that file.
  992. X.TP
  993. X\fB-k\fP
  994. XUse a specific disc file rather than the default physical
  995. Xmemory (\fB/dev/mem\fP)
  996. Xand kernel virtual memory (\fB/dev/kmem\fP) files. The next argument is taken
  997. Xto be the name of a suitable memory dump file.
  998. XThis flag automatically sets the \fB-o\fP flag.
  999. X.TP
  1000. X\fB-s\fP
  1001. XThis option is used in conjunction with the \fB-i\fP option.
  1002. XThe next argument is taken to be the name of a suitable kernel executable
  1003. Xfile, rather than the default (\fB/vmunix\fP).
  1004. X\fISps\fP looks at the symbol table of this file to determine
  1005. Xthe virtual addresses of various kernel structures.
  1006. X.SH OUTPUT
  1007. X\fISps\fP produces output in the following fields -
  1008. X.TP 8
  1009. X\fITy\fP
  1010. XThe terminal identifier to which the process is attached.
  1011. X.IP
  1012. XIf this is followed by an underscore, the process is detached.
  1013. XIf it is followed by a period, the process is running in the foreground.
  1014. XOtherwise the process is running in the background but is still
  1015. Xattached to a terminal.
  1016. X.TP
  1017. X\fIUser\fP
  1018. XThe symbolic name of the process' effective user-id (see \fIexec\fP(2)
  1019. Xand \fIsetuid\fP(2)).
  1020. XThis name is defined by the system password file (\fB/etc/passwd\fP)
  1021. Xwhen \fIsps\fP was last initialised.
  1022. XOtherwise, an asterisk (*) or vertical bar (|) appearing in this
  1023. Xcolumn denotes that the process is an immediate relative of the
  1024. Xpreceding process.
  1025. XA bar is listed, rather than an asterisk, if both processes belong
  1026. Xto the same process group.
  1027. XA user name is listed only if the effective user-id
  1028. Xdiffers from that of the preceding process or if it is a top-level
  1029. Xprocess (immediate offspring of process 1).
  1030. X.TP
  1031. X\fIProc#\fP
  1032. XThe unique process identifier.
  1033. X.TP
  1034. X\fIPpid#\fP
  1035. XThe process-id of the process' parent.
  1036. X.TP
  1037. X\fIPgrp#\fP
  1038. XThe process group to which the process belongs.
  1039. X.TP
  1040. X\fICommand\fP
  1041. XThe command arguments obtained from the process' own address space.
  1042. X(If the command name appears in parentheses, \fIsps\fP
  1043. Xwas unable to locate the arguments in user space and so reports
  1044. Xthe system's idea of the command name.)
  1045. X.PP
  1046. XThe following additional fields are listed when \fIsps\fP
  1047. Xis invoked with one of the \fB-l\fP or \fB-v\fP options -
  1048. X.TP 8
  1049. X\fIStatus\fP
  1050. XThe process' current state.
  1051. XIf this field is listed in upper-case letters, the process is currently
  1052. Xloaded in real memory space ; otherwise it has been swapped out.
  1053. XThe status field may contain one of the following descriptions -
  1054. X.RS 8
  1055. X.TP 16
  1056. X\fIrun\fP
  1057. XThe process can be run immediately.
  1058. X.TP
  1059. X\fIstop\fP
  1060. XThe process is stopped. See \fIsigvec\fP(2).
  1061. X.TP
  1062. X\fIexit\fP
  1063. XThe process is a zomby.
  1064. X.RE
  1065. X.IP
  1066. XAny other entry in the status field indicates the process is
  1067. Xwaiting for some external event to occur.
  1068. XThis is usually for one of the reasons listed below.
  1069. X(If \fIsps\fP does not know why a process is waiting, it lists
  1070. Xthe hexadecimal address of the process' wait channel,
  1071. Xwith the initial 80000000 trimmed off.)
  1072. XA process may be waiting for one of the following reasons -
  1073. X.RS 8
  1074. X.TP 16
  1075. X\fIchild\fP
  1076. XThe process is waiting for a child to terminate. See \fIwait\fP(2).
  1077. X.TP
  1078. X\fIpause\fP
  1079. XWaiting for a signal to be received. See \fIsigpause\fP(2).
  1080. X.TP
  1081. X\fIswap\fP
  1082. XWaiting for a page to be swapped in.
  1083. X.TP
  1084. X\fIrswbuf\fP
  1085. XWaiting for a read from the swap device \fB/dev/drum.\fP
  1086. X.TP
  1087. X\fIdiscio\fP
  1088. XWaiting for a disc read or write operation.
  1089. X(Actually, this means that the process is waiting for an operation
  1090. Xthrough the kernel's I/O buffering mechanism to complete, but \fIdiscio\fP
  1091. Xis what is generally meant here).
  1092. X.TP
  1093. X\fIrpipe\fP
  1094. X.br
  1095. X.ns
  1096. X.TP
  1097. X\fIwpipe\fP
  1098. XWaiting for a read from an empty pipe.  Alternatively, the process
  1099. Xis waiting to write to a full pipe. See \fIpipe\fP(2).
  1100. X.TP
  1101. X\fIrsockt\fP
  1102. X.br
  1103. X.ns
  1104. X.TP
  1105. X\fIwsockt\fP
  1106. XWaiting for a read from an empty socket.
  1107. XAlternatively, the process is waiting to write to a full socket (4.[2-]bsd only).
  1108. X.TP
  1109. X\fIaccept\fP
  1110. XWaiting to accept a stream-based socket connection (4.[2-]bsd only).
  1111. XSee \fIaccept\fP(2).
  1112. X.TP
  1113. X\fIconnct\fP
  1114. XWaiting to establish a connection through a stream-based socket to a
  1115. Xremote process (4.[2-]bsd only). See \fIconnect\fP(2).
  1116. X.TP
  1117. X\fIsocket\fP
  1118. XWaiting for some other time-out event on a socket (4.[2-]bsd only).
  1119. X.TP
  1120. X\fIselect\fP
  1121. XBlocked by a \fIselect\fP(2) system call (4.[2-]bsd only).
  1122. X.TP
  1123. X\fIrmux\fP
  1124. XWaiting for a read from a multiplexor file (4.1bsd only).
  1125. X.TP
  1126. X\fIinode\fP
  1127. XWaiting for an inode to be allocated or unlocked.
  1128. X.TP
  1129. X\fIexlock\fP
  1130. X.br
  1131. X.ns
  1132. X.TP
  1133. X\fIshlock\fP
  1134. XWaiting for a file to become unlocked. See \fIflock\fP(2).
  1135. X.TP
  1136. X\fIrtty??\fP
  1137. X.br
  1138. X.ns
  1139. X.TP
  1140. X\fIwtty??\fP
  1141. X.br
  1142. X.ns
  1143. X.TP
  1144. X\fIotty??\fP
  1145. XWaiting for a read or write to the specified terminal, or for the terminal
  1146. Xto be switched on. See \fItty\fP(4).
  1147. XAlternatively, waiting for a read or write to the
  1148. Xspecified slave pty device. See \fIpty\fP(4).
  1149. X.TP
  1150. X\fIrpty??\fP
  1151. X.br
  1152. X.ns
  1153. X.TP
  1154. X\fIwpty??\fP
  1155. XWaiting for a read or write to the specified master pty device.
  1156. XSee \fIpty\fP(4).
  1157. X.TP
  1158. X\fIptrace\fP
  1159. XThis is a parent process tracing its child.
  1160. X.TP
  1161. X\fIvfork\fP
  1162. XThis is a vforking parent process waiting for its child to relinquish
  1163. Xmemory resources. See \fIvfork\fP(2).
  1164. X.TP
  1165. X\fIfloppy\fP
  1166. X.br
  1167. X.ns
  1168. X.TP
  1169. X\fIprintr\fP
  1170. X.br
  1171. X.ns
  1172. X.TP
  1173. X\fIr??buf\fP
  1174. XWaiting for the specified device to complete an I/O operation.
  1175. X.RE
  1176. X.TP 8
  1177. X\fIFl\fP
  1178. XFlags associated with the current state of the process.
  1179. XThese flags may be any of the following -
  1180. X.RS 8
  1181. X.TP 16
  1182. X\fIU\fP
  1183. XThe process is a UNIX system process.
  1184. X.TP
  1185. X\fIT\fP
  1186. XThe process is being traced or debugged.
  1187. X.TP
  1188. X\fIV\fP
  1189. XThe process is a child currently being vforked. See \fIvfork\fP(2).
  1190. X.TP
  1191. X\fII\fP
  1192. XThe process is undergoing physical I/O.
  1193. X.TP
  1194. X\fIA\fP
  1195. XThe system has detected, or the user has warned of
  1196. Xanomalous paging behaviour. See \fIvadvise\fP(2).
  1197. X.RE
  1198. X.TP 8
  1199. X\fINice\fP
  1200. XThe "niceness" of the process. See \fInice\fP(2).
  1201. X.TP
  1202. X\fIVirtual\fP
  1203. XThe virtual memory size of the process in kilobytes.
  1204. XThe first figure indicates the sum of the data and stack segments,
  1205. Xthe second figure that of the text segment.
  1206. X.TP
  1207. X\fIResident\fP
  1208. XThe resident memory size of the process in kilobytes, representing
  1209. Xthe real memory devoted to the process.
  1210. X.TP
  1211. X\fI%M\fP
  1212. XThe percentage of available real memory allocated to this process.
  1213. X.TP
  1214. X\fITime\fP
  1215. XThe total CPU time accumulated by this process.
  1216. X(This is the sum of the system plus user times, unless the \fB-q\fP
  1217. Xflag is specified in which case only the user time is listed.)
  1218. X.TP
  1219. X\fIChild\fP
  1220. XThe total CPU time accumulated by the process' children.
  1221. X(This is the sum of the system plus user times, unless the \fB-q\fP
  1222. Xflag is specified.)
  1223. X.TP
  1224. X\fI%C\fP
  1225. XThe percentage of available CPU time devoted to the process.
  1226. XThis figure is a decaying average, computed over the past second.
  1227. X.PP
  1228. XThe following fields are listed when \fIsps\fP is invoked with the
  1229. X\fB-d\fP option -
  1230. X.TP 8
  1231. X\fIFiles\fP
  1232. XThe number of open files for this process.
  1233. X.TP
  1234. X\fIPageFaults\fP
  1235. XThe number of major and minor page faults incurred by the process.
  1236. X.TP
  1237. X\fISwap\fP
  1238. XThe number of swaps incurred by the process.
  1239. X.TP
  1240. X\fIBlockI/O\fP
  1241. XThe number of block read or write operations performed
  1242. Xon behalf of the process.
  1243. X.TP
  1244. X\fIKbytesecs\fP
  1245. XThe integral of real memory usage over time.
  1246. XThus, if a process uses 60 kilobytes of real memory for 3 seconds,
  1247. Xthis figure is incremented by 180.
  1248. X.PP
  1249. XThe following fields are listed when \fIsps\fP is invoked with the
  1250. X\fB-y\fP option -
  1251. X.TP 8
  1252. X\fIDev\fP
  1253. XThe major and minor device numbers of the terminal.
  1254. X.TP
  1255. X\fIAddr\fP
  1256. XThe virtual address of the associated \fBstruct tty\fP in \fB/dev/kmem\fP.
  1257. X.TP
  1258. X\fIRawq\fP
  1259. X.br
  1260. X.ns
  1261. X.TP
  1262. X\fICanq\fP
  1263. X.br
  1264. X.ns
  1265. X.TP
  1266. X\fIOutq\fP
  1267. XThe number of characters in the terminal I/O queues.
  1268. XThese refer to the raw input queue, the canonical input queue
  1269. Xand the output queue.
  1270. X.TP
  1271. X\fIPgrp\fP
  1272. XThe process group associated with the terminal.
  1273. X.PP
  1274. XAfter listing the requested output, \fIsps\fP prints a summary line.
  1275. XThis indicates the number and total virtual memory size of all processes,
  1276. Xthe number and total virtual size of busy processes,
  1277. Xthe number and real memory size of loaded processes
  1278. Xand the number and real size of swapped processes.
  1279. X.SH DIAGNOSTICS
  1280. X\fISps\fP reports a self-explanatory message if it is given an
  1281. Xinvalid argument list.
  1282. XThe program also complains if it cannot find necessary system information.
  1283. X.PP
  1284. XAt initialisation, \fIsps\fP complains if it cannot find the addresses of
  1285. Xrequisite system structures in the kernel symbol file.
  1286. XThis is usually the case because the system is rarely configured to support
  1287. Xall known devices.
  1288. X\fISps\fP also complains if more than one user shares the same user-id
  1289. Xin the password file (\fB/etc/passwd\fP).
  1290. X.SH EXAMPLES
  1291. X\fBsps vb\fP
  1292. X.PP
  1293. X\fISps\fP describes all busy processes in a verbose manner.
  1294. X.PP
  1295. X\fBsps dtg 9 h1 co\fP
  1296. X.PP
  1297. X\fISps\fP lists processes associated with terminals 9, h1 and the console.
  1298. XThe output reflects the disc activity caused by these processes.
  1299. XThe process group of each process is also included in the output.
  1300. X.PP
  1301. X\fBsps weu robert fred -r 2\fP
  1302. X.PP
  1303. X\fISps\fP reports processes belonging to the specified users.
  1304. XIt lists the environment as well as all the command arguments in a wide format.
  1305. XThe output is produced indefinitely, with a delay of two seconds between
  1306. Xeach listing.
  1307. X.PP
  1308. X\fBsps is /vmunix.new\fP
  1309. X.PP
  1310. X\fISps\fP is initialised. It reads its symbol information from the
  1311. Xspecified file.
  1312. X.SH FILES
  1313. X.ta 2.5i
  1314. X.nf
  1315. X/dev/console    Console
  1316. X/dev/tty??    Terminal and pty devices
  1317. X/dev/kmem    Kernel virtual memory
  1318. X/dev/mem    Physical memory
  1319. X/dev/drum    Paging and swap device
  1320. X/etc/passwd    Password file
  1321. X/etc/spsinfo    Information file
  1322. X/vmunix    Symbol file of /dev/kmem addresses
  1323. X/etc/termcap    To determine the output terminal width
  1324. X.fi
  1325. X.ta
  1326. X.SH SEE ALSO
  1327. X\fIiostat\fP(1), \fIkill\fP(1), \fIps\fP(1),
  1328. X\fIvmstat\fP(1), \fIexec\fP(2),
  1329. X\fIflock\fP(2), \fInice\fP(2), \fIpause\fP(2), \fIselect\fP(2), \fIsetuid\fP(2),
  1330. X\fIsigvec\fP(2), \fIvadvise\fP(2), \fIvfork\fP(2), \fIwait\fP(2),
  1331. X\fIpty\fP(4),\fItty\fP(4), \fIpstat\fP(8).
  1332. X.SH AUTHORS
  1333. XSeveral. In particular, J. E. Kulp and J. Robert Ward.
  1334. X.LP
  1335. XCurrently maintained by J. Robert Ward, \fB<robert@hslrswi.UUCP>\fP
  1336. X.SH BUGS
  1337. XBecause the system is continually changing, the information reported by
  1338. X\fIsps\fP is only an approximation to reality.
  1339. XIf invoked by root, \fIsps\fP renices itself to -20 in an attempt to run as
  1340. Xfast as possible.
  1341. X.PP
  1342. X\fISps\fP recognises the sizes and addresses of internal kernel
  1343. Xtables whenever it is invoked. However, it must be recompiled
  1344. Xif major modifications are made to the kernel.
  1345. X.PP
  1346. X\fISps\fP does not list all the detailed information shown by \fIps\fP(1).
  1347. XNor are all the options supported by \fIps\fP(1) available from \fIsps\fP.
  1348. X.PP
  1349. X\fISps\fP does not understand all the possible
  1350. Xreasons why a process may be sleeping.
  1351. X.PP
  1352. XThe code of \fIsps\fP is inherently machine-dependent and non-portable.
  1353. X.PP
  1354. XThe number of options to \fIsps\fP is ridiculous.
  1355. X
  1356. END_OF_sps.man
  1357. if test 14462 -ne `wc -c <sps.man`; then
  1358.     echo shar: \"sps.man\" unpacked with wrong size!
  1359. fi
  1360. # end of overwriting check
  1361. fi
  1362. echo shar: End of archive 3 \(of 3\).
  1363. cp /dev/null ark3isdone
  1364. MISSING=""
  1365. for I in 1 2 3 ; do
  1366.     if test ! -f ark${I}isdone ; then
  1367.     MISSING="${MISSING} ${I}"
  1368.     fi
  1369. done
  1370. if test "${MISSING}" = "" ; then
  1371.     echo You have unpacked all 3 archives.
  1372.     rm -f ark[1-9]isdone
  1373. else
  1374.     echo You still need to unpack the following archives:
  1375.     echo "        " ${MISSING}
  1376. fi
  1377. ##  End of shell archive.
  1378. exit 0
  1379. -- 
  1380.  
  1381. Rich $alz            "Anger is an energy"
  1382. Cronus Project, BBN Labs    rsalz@bbn.com
  1383. Moderator, comp.sources.unix    sources@uunet.uu.net
  1384.